/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package nutz.cyx.aop;


import org.nutz.aop.InterceptorChain;
import org.nutz.aop.MethodInterceptor;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.log.Log;
import org.nutz.log.Logs;


/**
 * 处理未预期的异常与系统锁定的情况
 */

@IocBean
public class ExceptionHandle implements MethodInterceptor {

    private static final Log log = Logs.getLog(ExceptionHandle.class);

    @Override
    public void filter(InterceptorChain ic) throws Throwable {
        try {
            ic.doChain();
        } catch (Exception ex) {
            ic.setReturnValue("出现了未知错误");
            //        log.fatal(ex.getMessage());
            return;
        }
    }
}
